home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / OS2 / V15N04.ZIP / PBPRNT.TXT < prev    next >
Encoding:
Text File  |  1996-01-23  |  958 b   |  29 lines

  1. method pushButton(var eventInfo Event)
  2. var
  3.   tsPrn TextStream                  ; Printer textStream
  4.   tcTable TCursor                   ; TCursor for table
  5.   sPrintline String                 ; String that holds print line
  6. endvar
  7.  
  8. tsPrn.open("prn","w")               ; Open the printer for writing
  9.  
  10. tcTable.open("Cust.db")             ; Open the Cust table
  11.  
  12. Scan tcTable :                      ; Loop through the entire table
  13.  
  14.   ; Construct a "label" by placing the data and special characters
  15.   ; in the sPrintline string
  16.  
  17.   sPrintline = "\n\n" + tcTable."Name" + "\n\r" + tcTable."Street" +
  18.   "\n\r" + tcTable."City" + ", " + tcTable."State/Prov" + " " +
  19.   tcTable."Zip/Postal Code" + "\n\r" + tcTable."Country" + "\n\n\n\r"
  20.  
  21.   tsPrn.writeLine( sPrintline )     ; Write the string to the printer
  22.  
  23. endScan
  24.  
  25. tcTable.close()                     ; Close the table
  26. tsPrn.close()                       ; Close the printer
  27.  
  28. endmethod
  29.